

#import <Foundation/Foundation.h>
#import "XLNetworkingHeader.h"

@interface XLNetworking : NSObject
/**
 * Server Url
 */
@property (nonatomic,   copy) NSString *baseUrl;
/**
 * timeOut, 30 seconds default
 */
@property (nonatomic, assign) NSInteger timeOutSecond;

+ (instancetype)shareManager;

- (void)netWorkRequestWithMethod:(XLRequestMethod)method
        andRequestSerializerType:(XLRequestSerializerType)requestType
       andResponseSerializerType:(XLResponseSerializerType)responseType
                          andUrl:(NSString *)urlString
                    andParamters:(NSDictionary *)paramters
                andResponseBlock:(ResponseBlock)responseBlock;


- (void)netWorkRequestUploadFileWithResponseSerializerType:(XLResponseSerializerType)responseType
                                                    andUrl:(NSString *)urlString
                                              andParamters:(NSDictionary *)paramters
                                          andResponseBlock:(ResponseBlock)responseBlock;

- (void)downloadSourceWithUrl:(NSString *)urlString
                  andFilePath:(NSString *)filePath
                     progress:(void (^)(NSProgress * downloadProgress))downloadProgressBlock
            completionHandler:(void (^)(NSString * filePath, NSError * error))completionHandler;


- (void)cancelAllNetwork;
@end


